import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        //动态数组
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();//字符个数
        int[] arr= new int[n];
        int target = in.nextInt();
        for (int i = 0; i <n ; i++) {
            arr[i] = in.nextInt();
        }
        System.out.println(Arrays.deepToString(combinationSum(arr, target)));
    }
    public static int[][] combinationSum (int[] candidates, int target) {
        // write code here
        int n = candidates.length;
        int[] arr =new int[n];//动态数组
        arr[0] = candidates[0];
        for (int i = 1; i < n; i++) {
            arr[i] = arr[i-1]+candidates[i];
        }
        int right = 0;
        int left=0;
        int[][] result = new int[2][];
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if(arr[i]-arr[j]==target){
                    left = j;
                    right = i;
                    break;
                }
            }
            if(left!=0&&right!=0){
                break;
            }
        }
        for (int i = left; i <= right; i++) {
            int flag = 0;
            result[0][flag] = candidates[i];
            flag++;
        }
        result[1][0] = target;
        return result;
    }
}
